package com.easy.controller;

import com.easy.bean.Inventory;
import com.easy.common.CommonResult;
import com.easy.common.OrderResult;
import com.easy.dao.IClassDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/inventory")
public class ClassController {
    @Autowired
    private IClassDao dao;


    @GetMapping("/class/count")
    public OrderResult getCountByClass(){
        List<Map<String, Object>> list = dao.getCountByClass();
        return OrderResult.success(list);
    }

    @GetMapping("/classa")
    public CommonResult getClassa() {
        List<Inventory> list = dao.getClassa();
        return CommonResult.success(list);
    }
    @GetMapping("/classb")
    public CommonResult getClassb() {
        List<Inventory> list = dao.getClassb();
        return CommonResult.success(list);
    }
    @GetMapping("/classc")
    public CommonResult getClassc() {
        List<Inventory> list = dao.getClassc();
        return CommonResult.success(list);
    }
    @GetMapping("/classd")
    public CommonResult getClassd() {
        List<Inventory> list = dao.getClassd();
        return CommonResult.success(list);
    }
    @GetMapping("/classe")
    public CommonResult getClasse() {
        List<Inventory> list = dao.getClasse();
        return CommonResult.success(list);
    }
    @GetMapping("/classf")
    public CommonResult getClassf() {
        List<Inventory> list = dao.getClassf();
        return CommonResult.success(list);
    }
    @GetMapping("/classh")
    public CommonResult getClassh() {
        List<Inventory> list = dao.getClassh();
        return CommonResult.success(list);
    }
    @GetMapping("/classg")
    public CommonResult getClassg() {
        List<Inventory> list = dao.getClassg();
        return CommonResult.success(list);
    }
    @GetMapping("/classi")
    public CommonResult getClassi() {
        List<Inventory> list = dao.getClassi();
        return CommonResult.success(list);
    }
    @GetMapping("/classj")
    public CommonResult getClassj() {
        List<Inventory> list = dao.getClassj();
        return CommonResult.success(list);
    }


}
